package com.tanhua.server.controller;

import com.tanhua.server.service.TaoHuaService;
import com.tanhua.dubbo.vo.AudioVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RequestMapping("peachblossom")
@RestController
public class TaoHuaController {
    @Autowired
    private TaoHuaService taoHuaService;

    @PostMapping
    public Object saveAudio(@RequestParam("soundFile") MultipartFile soundFile) {
        return taoHuaService.saveAudio(soundFile);
    }

    @GetMapping
    public AudioVo getAudio() {
        return taoHuaService.getAudio();
    }
}
